package com.android.canvasproject.model.entity;

import java.util.HashSet;
import java.util.Set;

public enum ColorEnum {
	
	COLOR_RED (1, "#FF5858"),
	COLOR_YELLOW (2, "#FBFF73"),
	COLOR_GREEN (3, "#B5FF73"),
	COLOR_BLUE (4, "#A8DAFF");
	
	private int code;
	private String hexaRGB;
	
	private ColorEnum(int code, String hexaRGB){
		this.code = code;
		this.hexaRGB = hexaRGB;
	}
	
	public ColorEnum getColorByCode(int code) {
		ColorEnum color = null;
		for(ColorEnum c : ColorEnum.values())
			if(c.code == code)
				color = c;

		return color;
	}

	public Set<String> getColorsRGB(){
		Set<String> listResult = new HashSet<String>();
		for(ColorEnum c : ColorEnum.values())
			listResult.add(c.hexaRGB);

		return listResult;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getHexaRGB() {
		return hexaRGB;
	}

	public void setHexaRGB(String hexaRGB) {
		this.hexaRGB = hexaRGB;
	}
}